#ifndef _UI_H
#define _UI_H
#include <common.h>
#include <disp_manager.h>
#include <input_manager.h>


#define BUTTON_DEFAULT_COLOR 0xff0000 // 按钮默认颜色为红色
#define BUTTON_PRESSED_COLOR 0x0000ff // 按钮按下颜色为绿色
#define BUTTON_TEXT_COLOR 0x000000 // 按钮字体颜色为黑色

#define STATUS_DEFAULT 0 // 释放状态为0
#define STATUS_PRESSED 1 // 按下状态为1

struct Button;

typedef int (*ONDRAW_FUNC)(struct Button *ptButton, DispBuff *ptDispBuff);
typedef int (*ONPRESSED_FUNC)(struct Button *ptButton, DispBuff *ptDispBuff, InputEvent *ptInputEvent); 


typedef struct Button
{   
    int status;
    char *name;
    Region tRegion; // 用Region结构体表示按钮的位置
    ONDRAW_FUNC OnDraw; 
    ONPRESSED_FUNC OnPressed; 
}Button, *PButton;

int InitButton(PButton ptButton, char *name, PRegion ptRegion, ONDRAW_FUNC OnDraw, ONPRESSED_FUNC OnPressed);


#endif